/**
 * Description:
 * Class Name:RuntimeTest
 * Date:2022/2/17 14:29
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第7章_Java基础类库._7_2_系统相关._7_2_2_Runtime类与Java9的ProcessHandle;

public class RuntimeTest {
    public static void main(String[] args) {
        // 获取Java程序关联的运行时对象
        var rt = Runtime.getRuntime();
        System.out.println("处理器数量：" + rt.availableProcessors());
        // 输出内存信息，单位为字节
        System.out.println("空闲的内存数：" + rt.freeMemory());
        System.out.println("总内存数：" + rt.totalMemory());
        System.out.println("最大可用内存数：" + rt.maxMemory());
    }
}
